
/**
 * Popups
 * --------------------------------------------------
 */

.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;

  @include display-flex();
  @include justify-content(center);
  @include align-items(center);
  // Start hidden
  visibility: hidden;

  // z-index: $z-index-popup;
  z-index: 501;

  &.popup-showing {
    visibility: visible;
  }

  &.popup-hidden {
    display: none;
  }

  &.popup-hidden .popup {
    @include animation-name(scaleOut);
    @include animation-duration($popup-leave-animation-duration);
    @include animation-timing-function(ease-in-out);
    @include animation-fill-mode(both);
  }

  &.active .popup {
    @include animation-name(superScaleIn);
    @include animation-duration($popup-enter-animation-duration);
    @include animation-timing-function(ease-in-out);
    @include animation-fill-mode(both);
  }

  .popup-mask {
    background: rgba(0,0,0,.8);
    position: fixed;;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }

  .popup {
    width: $popup-width;
    max-width: 100%;
    max-height: 90%;

    // border-radius: $popup-border-radius;
    border-radius: 4px;
    // background-color: $popup-background-color;
    background-color: $light;

    @include display-flex();
    @include flex-direction(column);
    @include user-select(none);

    // z-index: $z-index-popup + 1;
    z-index: 502;
  }

  input,
  textarea {
    width: 100%;
  }
}

.popup-head {
  padding: 15px 10px;
  border-bottom: 1px solid #eee;
  text-align: center;
}
.popup-title {
  margin: 0;
  padding: 0;
  font-size: 15px;
}
.popup-sub-title {
  margin: 5px 0 0 0;
  padding: 0;
  font-weight: normal;
  font-size: 11px;
}
.popup-body {
  padding: 10px;
  overflow: auto;
}

.popup-buttons {
  @include display-flex();
  @include flex-direction(row);
  padding: 10px;
  min-height: $popup-button-min-height + 20;

  .button {
    @include flex(1);
    display: block;
    min-height: $popup-button-min-height;
    border-radius: $popup-button-border-radius;
    line-height: $popup-button-line-height;

    margin-right: 5px;
    &:last-child {
      margin-right: 0px;
    }
  }
}

.popup-open {
  pointer-events: none;

  &.modal-open .modal {
    pointer-events: none;
  }

  .popup-backdrop, .popup {
    pointer-events: auto;
  }
}

.ux-popmenu {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  overflow: hidden;
  @include transition(all cubic-bezier(.36, .66, .04, 1) 250ms);

  &.visible {
    display: block;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.498039);
    @include transition(all cubic-bezier(.36, .66, .04, 1) 420ms);
  }
}
.ux-popmenu .content {
  position: absolute;
  left: 0;
  bottom: 0;
  @include translate(0, 100%);
  width: 100%;
  background: #e7e7e7;
  box-shadow: 0 -1px 40px rgba(0, 0, 0, .3);
  @include transition(all cubic-bezier(.36, .66, .04, 1) 250ms);
}
.ux-popmenu .content.show {
  @include translate(0, 0);
  @include transition(all cubic-bezier(.36, .66, .04, 1) 420ms);
}
.ux-popmenu header {
  height: 87px;
  padding: 8px 0;
  text-align: center;
  background: #f8f8f8;
  font-size: 12px;
  margin-bottom: 1px
}
.ux-popmenu header a {
  overflow: hidden;
  display: inline-block;
  text-align: center
}
.ux-popmenu header span {
  color: #333;
  display: block
}
.ux-popmenu header i {
  width: 40px;
  height: 40px;
  margin: 18px 18px 6px;
  border-radius: 5px;
  border: 1px solid #a4a4a4;
  font-size: 40px;
  color: #a4a4a4;
  display: block;
  position: relative
}
.ux-popmenu header .num {
  position: absolute;
  top: -12px;
  right: -12px;
  padding: 0 8px;
  line-height: 24px;
  font-size: 1rem;
  color: #fff;
  background: #ff5b36;
  -webkit-border-radius: 12px;
  border-radius: 12px;
  -webkit-transform: scale(0.625);
  transform: scale(0.625)
}
.ux-popmenu section a {
  display: block;
  height: 48px;
  line-height: 48px;
  text-align: center;
  font-size: 16px;
  background: #f8f8f8;
  color: #333;
  margin-bottom: 1px
}

.ux-popmenu section a[node-type~="del"] {
  color: $assertive;
}
.ux-popmenu section span {
  display: block;
  background: #f8f8f8
}
.ux-popmenu section .close {
  padding: 4px 0 0;
  background: #e7e7e7;
  color: #333;
}
